home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 1 / LSD Compendium Deluxe 1.iso / a / programming / misc / ada1110b.lha / AmigaSources / vars.h < prev   
Encoding:
C/C++ Source or Header  |  1993-07-10  |  8.2 KB  |  288 lines

  1. /*
  2.  * Copyright (C) 1985-1992  New York University
  3.  * 
  4.  * This file is part of the Ada/Ed-C system.  See the Ada/Ed README file for
  5.  * warranty (none) and distribution info and also the GNU General Public
  6.  * License for more details.
  7.  
  8.  */
  9. #ifndef _vars_h
  10. #define _vars_h
  11.  
  12.  
  13. /* vars.ch - global declarations and initializations */
  14.  
  15. /*
  16.  *T+ GLOBAL DECLARATIONS and DEF =  IONS
  17.  *S+ Constants
  18.  */
  19.  
  20. extern  double    ADA_MIN_REAL;
  21. extern  double    ADA_MAX_REAL;
  22. extern  int    ADA_REAL_DIGITS;
  23. extern  int    cdebug2;
  24.  
  25. extern  Declaredmap declared_all[4];    /* array of standard declareds */
  26. extern  int    full_others;  /* a boolean */
  27. extern  int    fold_context; /* a boolean */
  28. extern  int    node_count;
  29. extern  Node current_node;
  30. extern  Node OPT_NODE;    /*initialized in sem0 */
  31.  
  32. /* Initialized in SEM =   */
  33. /*
  34. ??const qualifiers = {as_qual_range,  as_qual_length,  as_qual_discr,
  35.             as_qual_arange, as_qual_alength, as_qual_adiscr };
  36.  */
  37.  
  38. /*S+ Variables*/
  39.  /* declared map from standard environment */
  40. /*base_declared is array of copies of maps for standard0,standard,
  41. umnentionable0, and ascii. base_declared_symbols is corresponding
  42. array of symbol table pointers */
  43. extern  Declaredmap base_declared[4];
  44. extern  Symbol base_declared_symbols[4];
  45. extern  Tuple scope_st;            /* stack of lexical scopes */
  46. extern  Tuple has_return_stk;        /* stack to track return statements */
  47. extern  Tuple newtypes;            /* list of type declaration code to be */
  48.  /* emitted before declaration being processed. */
  49. extern  Tuple lab_seen;            /* set of labels in procedure . */
  50. extern  Tuple current_instances;    /* stack for recursive instantiation check */
  51.  
  52. extern  Symbol scope_name;        /* unique name for each scope */
  53. extern  char *unit_name;        /* compilation unit information */
  54. extern  Tuple all_vis;            /* Modules whose visibility is required */
  55.                 /* all_vis used only in ch. 10 */
  56.  
  57. extern  Tuple open_scopes;        /* nest of currently open scopes, from inner */
  58.  /* to outer.  Outermost is STANDARD. */
  59. extern  Tuple used_mods;        /* packages appearing in a use clause */
  60. extern  Tuple vis_mods;    /* list of package names visible in this unit*/
  61.  
  62. extern  int    noop_error;
  63.  
  64.  /* used by procs init_compunit and compunit. */
  65. extern  Set non_local_names;        /* To collect non_local references in each subp. */
  66.  
  67. extern  int    out_context;        /* Signals valid appearance of out parameter.  */
  68.  
  69. extern  Symbol
  70. symbol_and,
  71. symbol_andthen,
  72. symbol_any,
  73. symbol_any_id,
  74. symbol_array_type,
  75. symbol_ascii,
  76. symbol_assign,
  77. symbol_boolean,
  78. symbol_boolean_type,
  79. symbol_callable,
  80. symbol_character,
  81. symbol_character_type,
  82. symbol_constrained,
  83. symbol_constraint_error,
  84. symbol_daccess,
  85. symbol_dfixed,
  86. symbol_discrete_type,
  87. symbol_divfx,
  88. symbol_duration,
  89. symbol_eq,
  90. symbol_exception,
  91. symbol_float,
  92. symbol_ge,
  93. symbol_gt,
  94. symbol_in,
  95. symbol_incomplete,        /* incomplete, for incp_types */
  96. symbol_integer,
  97. symbol_le,
  98. symbol_left,
  99. symbol_limited,            /* limited for priv_types, incp_types */
  100. symbol_limited_private,        /* cf. symbol_limited */
  101. symbol_long_float,
  102. symbol_long_integer,
  103. symbol_lt,
  104. symbol_main_task_type,
  105. symbol_mulfx,
  106. symbol_natural,
  107. symbol_none,
  108. symbol_not,
  109. symbol_ne,
  110. symbol_notin,
  111. symbol_null,
  112. symbol_numeric,
  113. symbol_numeric_error,
  114. symbol_or,
  115. symbol_order_type,
  116. symbol_orelse,
  117. symbol_overloaded,
  118. symbol_positive,
  119. symbol_private,            /* for priv_types, incp_types */
  120. symbol_program_error,
  121. symbol_right,
  122. symbol_short_integer,
  123. symbol_short_integer_base,
  124. symbol_standard,
  125. symbol_standard0,
  126. symbol_storage_error,
  127. symbol_system_error,
  128. symbol_string,
  129. symbol_string_type,
  130. symbol_system,
  131. symbol_tasking_error,
  132. symbol_undef,
  133. symbol_universal_dfixed,
  134. symbol_universal_fixed,
  135. symbol_universal_integer,
  136. symbol_universal_integer_1,
  137. symbol_universal_real,
  138. symbol_unmentionable,
  139. symbol_xor;
  140.  
  141. /* following used in Chapter 4 mainly for check_type */
  142. extern  Symbol 
  143. symbol_universal_type,
  144. symbol_integer_type,
  145. symbol_real_type,
  146. symbol_composite_type,
  147. symbol_equal_type;
  148.  
  149.  
  150. extern  Symbol
  151. symbol_addu,  /* +u */
  152. symbol_subu,  /* -u */
  153. symbol_abs,  /* abs */
  154. symbol_add,  /* + */
  155. symbol_sub,  /* - */
  156. symbol_mul,  /* * */
  157. symbol_div,  /* / */
  158. symbol_mod,  /* mod */
  159. symbol_rem,  /* rem */
  160. symbol_exp,  /* ** */
  161. symbol_cat,  /* & */
  162. /* new symbols for the catenation operations */
  163. symbol_cat_cc, /* &cc */
  164. symbol_cat_ac, /* &ac */
  165. symbol_cat_ca, /* &ca */
  166. symbol_modi,  /* modi */
  167. symbol_remi,  /* remi */
  168. symbol_addui,  /* +ui */
  169. symbol_subui,  /* -ui */
  170. symbol_absi,  /* absi */
  171. symbol_addi,  /* +i */
  172. symbol_subi,  /* -i */
  173. symbol_muli,  /* *i */
  174. symbol_divi,  /* /i */
  175. symbol_addufl,    /* +ufl */
  176. symbol_subufl,    /* -ufl */
  177. symbol_absfl,  /* absfl */
  178. symbol_addfl,  /* +fl */
  179. symbol_subfl,  /* -fl */
  180. symbol_mulfl,  /* *fl */
  181. symbol_divfl,  /* /fl */
  182. symbol_addufx,    /* +ufx */
  183. symbol_subufx,    /* -ufx */
  184. symbol_absfx,  /* absfx */
  185. symbol_addfx,  /* +fx */
  186. symbol_subfx,  /* -fx */
  187. symbol_mulfxi,    /* *fxi */
  188. symbol_mulifx,    /* *ifx */
  189. symbol_divfxi,    /* /fxi */
  190. symbol_mulfli,    /* *fli */
  191. symbol_mulifl,    /* *ifl */
  192. symbol_divfli,    /* /fli */
  193. symbol_expi,  /* **i */
  194. symbol_expfl;  /* **fl */
  195.  
  196. extern  Tuple unary_sig;
  197. extern  Tuple binary_sig; /* TBSL: to be initialized in sem0*/
  198.  
  199. extern  int num_predef_units; /* number of units in predef.ada */
  200.  
  201. extern  int errors; /* flag if errors are present*/
  202.  
  203. /* adaval_overflow is set to indicate overflow from adaval; corresponds
  204.  * to SETL ADAVAL returning 'OVERFLOW'
  205.  */
  206. extern  int adaval_overflow; 
  207. extern  char *FILENAME;
  208. extern  FILE *MSGFILE;
  209. /* added 24 sep 84*/
  210. /* init_nodes is tuple of nodes needed by save_tree (10) */
  211. extern  Tuple init_nodes;
  212. extern  Tuple init_symbols; /* tuple of symbols created by sem initialization*/
  213. /* varying length tuple, unit_nodes_n gives current length */
  214. extern  Tuple unit_nodes;
  215. #ifdef TBSL
  216. extern  int unit_nodes_n;
  217. #endif
  218. extern  char *PREDEFNAME; /* name of predef file */
  219. extern  char *AISFILENAME;
  220. extern  int lib_option;
  221. extern  int new_library; /* set if creating library */
  222. extern  struct unit *pUnits[MAX_UNITS+1];
  223. extern  Tuple lib_stub;
  224. extern  Tuple stub_info;
  225.  
  226. extern  int seq_node_n; /* number of nodes allocated */
  227. extern  Tuple seq_node; /* tuple of allocated nodes*/
  228. extern  int seq_symbol_n;/* number of symbols allocated*/
  229. extern  Tuple seq_symbol;    /* tuple of allocated symbols */
  230.  
  231. /* added 12 oct 84 to track nodes read from ast */
  232. extern  int unit_number_now;
  233. extern  int unit_numbers;
  234. extern  int empty_unit_slots;
  235.  
  236. /* following variables used to trap references to selected node or symbol.
  237.  * Node specified by trapns and trapnu (giving node sequence and unit),
  238.  * symbol specified by trapss and trapsu (giving symbol sequence and unit).
  239.  * These are meaningful only if either nonzero. When a trapped node referenced,
  240.  * then procedure trap is called.
  241.  * Code to watch for traps is planted at several places, notably sym_new,
  242.  * node_new, zptupsym, zptupnod (these latter two do not call trap).
  243.  */
  244. extern  int trapns,trapnu,trapss,trapsu;
  245.  
  246. extern  Tuple aisunits_read;
  247.  
  248. extern  Nodemap node_map;
  249. /* OPT_NAME is used by code_generator but defined here so it can be
  250.  * referenced from libr procedures */
  251. extern  Symbol OPT_NAME; /* This is to symbols what OPT_NODE is to nodes*/
  252.  
  253. /* I/O trace flags used to get trace prints when reading and writing
  254.  * intermediate files. A trace level is one of the following:
  255.  *    0    no trace
  256.  *    1    brief trace
  257.  *    2    full trace.
  258.  */
  259. extern  int iot_ifile; /* current trace level for ifile */
  260. extern  int iot_ofile; /* current trace level for ofile */
  261. extern  int iot_ais_r; /* trace level for ais files read */
  262. extern  int iot_ais_w; /* trace level for ais files written */
  263. extern  int iot_tre_r; /* trace level for tre files read */
  264. extern  int iot_tre_w; /* trace level for tre files written */
  265. extern  int iot_lib_r; /* trace level for lib files read */
  266. extern  int iot_lib_w;/* set to trace writing lib file */
  267. extern  char iot_ofile_type;
  268. extern  char iot_ifile_type;
  269.  
  270. /* compiling predef */
  271. extern  int    compiling_predef; /* set if we are compiling predef */
  272.  
  273. /* the following are used to avoid having string literals in code that
  274.  * might be overlaid on the PC 
  275.  */
  276. extern  char *string_any_id; 
  277. extern  char *string_ok;
  278. extern  char *string_ds;
  279. /* variables to report result from power_of_2(), thus avoiding
  280.  * need to compute a tuple, as is done in SETL version.
  281.  */
  282. extern  int power_of_2_accuracy; 
  283. extern  int power_of_2_power;
  284. extern  Rational power_of_2_small;
  285. extern  Set stubs_to_write;
  286. extern  Tuple NOT_CHOSEN;
  287. #endif
  288.